﻿@model QDT.Web.Admin.Models.SmsServerModel
<div class="main_title">
    编辑 
    @Html.ActionLink("返回列表", "MsgInterfaceList", null, new { @class = "back_list" })
</div>
@using (Html.BeginForm("PostEditMsgInterface", "SmManagment", FormMethod.Post))
{
    <table class="form" cellpadding="0" cellspacing="0">
        <tbody><tr>
                   <td colspan="2" class="topTd"></td>
               </tr>
            <tr>
                <td class="item_title">接口名称:</td>
                <td class="item_input">
                    @Model.ServerName
                    <input type="button" class="button" value="查询余额" onclick="checkFee();" />
                </td>
            </tr>
            <tr>
                <td class="item_title">接口类名:</td>
                <td class="item_input">
                    @Model.ClassName<input type="hidden" value="@Model.ClassName" name="ClassName">
                </td>
            </tr>
            <tr>
                <td class="item_title">短信接口帐号:</td>
                <td class="item_input">
                    <input type="text"  class="textbox" name="UserName" value="@Model.UserName">
                </td>
            </tr>
            <tr>
                <td class="item_title">短信接口密码:</td>
                <td class="item_input">
                    <input type="password" class="textbox" value="@Model.Password" name="Password">
                </td>
            </tr>
            <tr>
                <td class="item_title">描述:</td>
                <td class="item_input">
                    <textarea class="textarea" name="Description" >@Model.Description</textarea>
                </td>
            </tr>
            @if (Model.Config != null) {
                <tr>
                    <td class="item_title">配置信息:</td>
                    <td class="item_input">
                        @foreach (var con in Model.Config) {
                            <span class="cfg_title">@Model.SmsLang[con.Key]:</span>
                            <span class="cfg_content">
                                @if (con.Value.Type == 0) {
                                    <span class="cfg_content">
                                        <input type="text" name="Config[@con.Key].Value" value="@con.Value.Value"/>
                                    </span>
                                }
                            </span>
                            <div class="blank5"></div>
                        }
                    
                    </td>
                </tr>
            }<tr>
                        <td class="item_title"></td>
                        <td class="item_input">
                            <!--隐藏元素-->
                            <input type="hidden" value="@Model.Id" name="Id"/>
                            <!--隐藏元素-->
                            <input type="submit" class="button" value="新增">
                            <input type="reset" class="button" value="重置">
                        </td>
                    </tr>
            <tr>
                <td colspan="2" class="bottomTd"></td>
            </tr>
        </tbody></table>
}
<script type="text/javascript">
    function checkFee() {
        var url = "/SmManagment/CheckFee";
        $.post(url, { }, function(result) {
            customerAlert(null,result);
        });
    }
</script>